package com.xoa.controller.qyweixin;

import com.xoa.model.qiyeWeixin.QiyeWeixinConfig;
import com.xoa.service.qyweixin.QiyeWeixinService;
import com.xoa.util.common.wrapper.BaseWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2019/5/31.
 */
@Controller
@RequestMapping("/qiyeWeixin")
public class QiyeWeixinController {

    //    下面是微信企业号映射
    @RequestMapping("/wechatIndex")
    public String wechatIndex() {
        return "/app/wechatManage/index";
    }

    //微信企业号设置
    @RequestMapping("/enterpriseSetting")
    public String enterpriseSetting() {
        return "/app/wechatManage/enterpriseSetting";
    }

    //基础参数设置
    @RequestMapping("/arameterSetting")
    public String arameterSetting() {
        return "/app/wechatManage/arameterSetting";
    }
    //同步部门
    @RequestMapping("/dataImport")
    public String dataImport() {
        return "/app/wechatManage/dataImport";
    }
    //数据导入 - 组织架构初始化
    @RequestMapping("/chooseDepartment")
    public String chooseDepartment() {
        return "/app/wechatManage/chooseDepartment";
    }
    //数据导入 - 人员和日志
    @RequestMapping("/importPersonnel")
    public String importPersonnel() {
        return "/app/wechatManage/importPersonnel";
    }
    //数据导入 - 人员
    @RequestMapping("/importPeople")
    public String importPeople() {
        return "/app/wechatManage/importPeople";
    }
    //公告通知
    @RequestMapping("/publicNotice")
    public String publicNotice() {
        return "/app/wechatManage/publicNotice";
    }
    //导入日志
    @RequestMapping("/importLogs")
    public String importLogs() {
        return "/app/wechatManage/importLogs";
    }
    //钉钉组织架构管理
    @RequestMapping("/organizationManagement")
    public String organizationManagement() {
        return "/app/wechatManage/organizationManagement";
    }
    //OA用户绑定
    @RequestMapping("/oaBinding")
    public String oaBinding() {
        return "/app/wechatManage/oaBinding";
    }
    //组织架构管理
    @RequestMapping("/organizational")
    public String organizational() {
        return "/app/wechatManage/organizationalStructure";
    }
    @RequestMapping("/wxToOa")
    public String wxToOa() {
        return "app/wechatManage/wxToOa";
    }


    @Autowired
    private QiyeWeixinService qiyeWeixinService;


    /**
     * @作者: 张航宁
     * @时间: 2019/5/31
     * @说明: 设置企业微信参数
     */
    @ResponseBody
    @RequestMapping("/setQiyeWeixinConfig")
    public BaseWrapper setQiyeWeixinConfig(QiyeWeixinConfig qiyeWeixinConfig){
        return qiyeWeixinService.setQiyeWeixinConfig(qiyeWeixinConfig);
    }

    /**
     * @作者: 张航宁
     * @时间: 2019/5/31
     * @说明: 获取企业微信参数
     */
    @ResponseBody
    @RequestMapping("/getQiyeWeixinConfig")
    public BaseWrapper getQiyeWeixinConfig(){
        return qiyeWeixinService.getQiyeWeixinConfig();
    }

}
